package com.synergy.stockflow.procure.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.production.entity.ProductionPlan;
import com.synergy.stockflow.warehouse.entity.Warehouse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "purchase_order")
public class PurchaseOrder {
    /**
     * 采购单编码
     */
    @TableId(value = "purchase_order_id", type = IdType.ASSIGN_ID)
    @Schema(description="采购单编码")
    private String purchaseOrderId;

    /**
     * 采购订单名称
     */
    @TableField(value = "purchase_order_name")
    @Schema(description="采购订单名称")
    private String purchaseOrderName;

    /**
     * 生产计划编码
     */
    @TableField(value = "purchase_order_production_planning_id")
    @Schema(description="生产计划编码")
    private String purchaseOrderProductionPlanningId;

    /**
     * 订单签订时间
     */
    @TableField(value = "purchase_order_date_of_signing")
    @Schema(description="订单签订时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date purchaseOrderDateOfSigning;

    /**
     * 交货时间
     */
    @TableField(value = "purchase_order_delivery_date")
    @Schema(description="交货时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date purchaseOrderDeliveryDate;

    /**
     * 采购员工编码
     */
    @TableField(value = "purchase_order_employee_id")
    @Schema(description="采购员工编码")
    private String purchaseOrderEmployeeId;

    /**
     * 供应商编码
     */
    @TableField(value = "purchase_order_vendor_id")
    @Schema(description="供应商编码")
    private String purchaseOrderVendorId;

    /**
     * 仓库编码
     */
    @TableField(value = "purchase_order_inbound_warehouse")
    @Schema(description="仓库编码")
    private String purchaseOrderInboundWarehouse;

    /**
     * 采购总数量
     */
    @TableField(value = "purchase_order_total_quantity")
    @Schema(description="采购总数量")
    private BigDecimal purchaseOrderTotalQuantity;

    /**
     * 采购原价
     */
    @TableField(value = "purchase_order_price")
    @Schema(description="采购原价")
    private BigDecimal purchaseOrderPrice;

    /**
     * 优惠金额
     */
    @TableField(value = "purchase_order_discount_amount")
    @Schema(description="优惠金额")
    private BigDecimal purchaseOrderDiscountAmount;

    /**
     * 折扣率
     */
    @TableField(value = "purchase_order_discount_rate")
    @Schema(description="折扣率")
    private BigDecimal purchaseOrderDiscountRate;

    /**
     * 优惠后采购金额
     */
    @TableField(value = "purchase_order_preferential_price")
    @Schema(description="优惠后采购金额")
    private BigDecimal purchaseOrderPreferentialPrice;

    /**
     * 金额大写
     */
    @TableField(value = "purchase_order_the_amount_is_capitalized")
    @Schema(description="金额大写")
    private String purchaseOrderTheAmountIsCapitalized;

    /**
     * 优惠后采购金额（不含税）
     */
    @TableField(value = "purchase_order_no_preferential_price")
    @Schema(description="优惠后采购金额（不含税）")
    private BigDecimal purchaseOrderNoPreferentialPrice;

    /**
     * 状态
     */
    @TableField(value = "purchase_order_state")
    @Schema(description="状态")
    private String purchaseOrderState;

    /**
     * 审批人编码
     */
    @TableField(value = "purchase_order_approver")
    @Schema(description="审批人编码")
    private String purchaseOrderApprover;

    /**
     * 地址
     */
    @TableField(value = "purchase_order_address")
    @Schema(description="地址")
    private String purchaseOrderAddress;

    /**
     * 详细地址
     */
    @TableField(value = "purchase_order_fulladdress")
    @Schema(description="详细地址")
    private String purchaseOrderFulladdress;

    /**
     * 使用/删除
     */
    @TableField(value = "purchase_order_isremove")
    @Schema(description="使用/删除")
    private Integer purchaseOrderIsremove;

    @TableField(exist = false)
    @Schema(description="员工姓名")
    private String nickname;

    @TableField(exist = false)
    @Schema(description="员工姓名")
    private String nickname1;

    /**
     * 供应商
     */
    @TableField(exist = false)
    @Schema(description="供应商")
    private Vendor vendor;
    /**
     * 供应商
     */
    @TableField(exist = false)
    @Schema(description="供应商")
    private SupplierPrices supplierPrices;

    /**
     * 仓库
     */
    @TableField(exist = false)
    @Schema(description="仓库")
    private Warehouse warehouse;

    /**
     * 生产计划
     */
    @TableField(exist = false)
    @Schema(description="生产计划")
    private ProductionPlan productionPlan;
    /**
     * 采购订单详情
     */
    @TableField(exist = false)
    @Schema(description="采购订单详情")
    private List<PurchaseDetails> purchaseDetailsList;
}